package com.example.sakurasay.viewmodels

import androidx.lifecycle.ViewModel
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.StateFlow
import kotlinx.coroutines.flow.asStateFlow
import kotlinx.coroutines.flow.update

data class ThemeUiState(
    val isDarkTheme: Boolean = false
)

class ThemeViewModel : ViewModel() {
    private val _uiState = MutableStateFlow(ThemeUiState())
    val uiState: StateFlow<ThemeUiState> = _uiState.asStateFlow()

    fun toggleTheme() {
        _uiState.update { currentState ->
            currentState.copy(isDarkTheme = !currentState.isDarkTheme)
        }
    }
}